﻿<%@ Page Language="C#" MasterPageFile="~/CgdShellMasterPage.master" AutoEventWireup="true" CodeFile="ContentList.aspx.cs" Inherits="ContentList" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" Runat="Server">
<div class="box">
	<div class="bt">
		<asp:Label ID="lblTitle" runat="server"></asp:Label>
		<a href='<%= GetRssUrl() %>'><img src='<%= UrlUtility.GetFullUrl("res/images/rss.gif") %>' alt="Rss" /></a>
	</div>
	<div class="bc">
		<form runat="server">
			<asp:Label ID="lblColumnId" runat="server" Visible="false"></asp:Label>
			<asp:LinqDataSource ID="ds" runat="server" 
				ContextTypeName="Cgd.Shell.Data.CgdShellDataContext" OrderBy="Time desc" 
				TableName="Documents" Where="Category=@Category">
				<WhereParameters>
					<asp:ControlParameter ControlID="lblColumnId" ConvertEmptyStringToNull="False" 
						Name="Category" PropertyName="Text" Type="Int32" />
				</WhereParameters>
			</asp:LinqDataSource>
			<asp:ListView ID="lstContents" runat="server" DataSourceID="ds">
				<LayoutTemplate>
					<div class="pgr">
						<asp:DataPager runat="server" PageSize="50">
							<Fields>
								<asp:NumericPagerField ButtonCount="20" />
							</Fields>
						</asp:DataPager>
					</div>
					<div id="itemPlaceHolder" runat="server">
					</div>
					<div class="pgr">
						<asp:DataPager runat="server" PageSize="20">
							<Fields>
								<asp:NumericPagerField ButtonCount="20" />
							</Fields>
						</asp:DataPager>
					</div>
				</LayoutTemplate>
				<ItemTemplate>
					<div>
						<div><span class="tt">[<%# ((DateTime)Eval("Time")).ToString("MM-dd HH:mm") %>]</span>
						<a href='<%# Eval("Url") %>' target="_blank"><%# Eval("Title") %></a></div>
						<p class="sum"><%# Eval("Summary") %></p>
					</div>
				</ItemTemplate>
				<ItemSeparatorTemplate><hr /></ItemSeparatorTemplate>
			</asp:ListView>
		</form>
	</div>
</div>
</asp:Content>

